import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)


export default new Vuex.Store({
  state: {
    //vuex中的数据
    token:'',
    id:''
  },
  mutations: {
    //普通方法
    setToken(state,token){
      state.token = token;
    },
    deleteToken(state){
      state.token = '';
    },

    setId(state,id){
      state.id = id;
    }

  },
  actions: {
    //异步方法
  },
  modules: {
  }
})
